package cn.bugstack.springframework.beans.factory.support;


import cn.bugstack.springframework.beans.factory.config.SingletonBeanRegistry;

import java.util.HashMap;
import java.util.Map;

/**
 * @author oyz
 */
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {


    private Map<String, Object> singleletonObjects = new HashMap<>();


    @Override
    public Object getSingleton(String beanName) {
        return singleletonObjects.get(beanName);
    }


    public void addSingleton(String beanName,Object singleletonObject){
        singleletonObjects.put(beanName,  singleletonObject);
    }




}
